<Window xmlns:xom="clr-namespace:Xomega.Framework;assembly=Xomega.Framework"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:l="clr-namespace:AdventureWorks.Client.Objects;assembly=AdventureWorks.Client.Objects"
        x:Class="AdventureWorks.Client.WPF.EmployeeSearch"
        Title="Employee Search"
        Height="480"
        Width="960">
   <Grid Margin="10">
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="*"/>
         <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Grid Name="pnlCriteria">
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
         </Grid.ColumnDefinitions>
         <Label Grid.Row="0" Grid.Column="0" Name="lblFirstName">First Name:</Label>
         <ComboBox Grid.Row="0" Grid.Column="1"
                   xom:Property.Label="{Binding ElementName=lblFirstName}"
                   Name="ctlFirstNameOperator"
                   xom:Property.Name="{x:Static l:EmployeeCriteria.FirstNameOperator}"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" Name="ctlFirstName"
                  xom:Property.Name="{x:Static l:EmployeeCriteria.FirstName}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Grid.Row="1" Grid.Column="0" Name="lblLastName">Last Name:</Label>
         <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"
                  xom:Property.Label="{Binding ElementName=lblLastName}"
                  Name="ctlLastName"
                  xom:Property.Name="{x:Static l:EmployeeCriteria.LastName}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Grid.Row="2" Grid.Column="0" Name="lblManagerLastName">Manager Last Name:</Label>
         <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
                  xom:Property.Label="{Binding ElementName=lblManagerLastName}"
                  Name="ctlManagerLastName"
                  xom:Property.Name="{x:Static l:EmployeeCriteria.ManagerLastName}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Grid.Row="0" Grid.Column="4" Name="lblHireDate">Hire Date:</Label>
         <ComboBox Grid.Row="0" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblHireDate}"
                   Name="ctlHireDateOperator"
                   xom:Property.Name="{x:Static l:EmployeeCriteria.HireDateOperator}"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="6" Name="ctlHireDate"
                  xom:Property.Name="{x:Static l:EmployeeCriteria.HireDate}"
                  Style="{StaticResource ControlStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="7" Name="ctlHireDate2"
                  xom:Property.Name="{x:Static l:EmployeeCriteria.HireDate2}"
                  Style="{StaticResource ControlStyle}"/>
         <Label Grid.Row="1" Grid.Column="4" Name="lblState">State:</Label>
         <ComboBox Grid.Row="1" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblState}"
                   Name="ctlStateOperator"
                   xom:Property.Name="{x:Static l:EmployeeCriteria.StateOperator}"
                   Style="{StaticResource OperatorStyle}"/>
         <ListBox Grid.Row="1" Grid.Column="6" Grid.ColumnSpan="2" Name="ctlState"
                  xom:Property.Name="{x:Static l:EmployeeCriteria.State}"
                  Style="{StaticResource ControlStyle}"
                  MaxHeight="58"/>
         <Label Grid.Row="2" Grid.Column="4" Name="lblZipcode">Zipcode:</Label>
         <ComboBox Grid.Row="2" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblZipcode}"
                   Name="ctlZipcodeOperator"
                   xom:Property.Name="{x:Static l:EmployeeCriteria.ZipcodeOperator}"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="2" Grid.Column="6" Grid.ColumnSpan="2" Name="ctlZipcode"
                  xom:Property.Name="{x:Static l:EmployeeCriteria.Zipcode}"
                  Style="{StaticResource ControlStyle}"/>
      </Grid>
      <Button Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,100,10"
              Name="btnSearch"
              Width="75"
              Click="btnSearch_Click">Search</Button>
      <Button Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,0,10"
              Name="btnReset"
              Width="75"
              Click="btnReset_Click">Reset</Button>
      <Button Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,0,10"
              Name="btnClose"
              Width="75"
              Click="btnClose_Click">Close</Button>
      <ListView Grid.Row="2" Name="gridResults">
         <ListView.View>
            <GridView>
               <GridView.Columns>
                  <GridViewColumn Header="Id">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:EmployeeRowObject.Id}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="First Name">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:EmployeeRowObject.FirstName}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Last Name">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:EmployeeRowObject.LastName}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Title">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:EmployeeRowObject.Title}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Hire Date">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:EmployeeRowObject.HireDate}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Manager">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:EmployeeRowObject.Manager}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Salaried">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <CheckBox xom:Property.Name="{x:Static l:EmployeeRowObject.Salaried}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Current">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <CheckBox xom:Property.Name="{x:Static l:EmployeeRowObject.Current}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Gender">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:EmployeeRowObject.Gender}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="State Id">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:EmployeeRowObject.StateId}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Street Address">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:AddressObject.StreetAddress}"
                                      xom:Property.ChildObject="{x:Static l:EmployeeRowObject.Address}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="City">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:AddressObject.City}"
                                      xom:Property.ChildObject="{x:Static l:EmployeeRowObject.Address}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="State">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:AddressObject.State}"
                                      xom:Property.ChildObject="{x:Static l:EmployeeRowObject.Address}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Zipcode">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:AddressObject.Zipcode}"
                                      xom:Property.ChildObject="{x:Static l:EmployeeRowObject.Address}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
                  <GridViewColumn Header="Country">
                     <GridViewColumn.CellTemplate>
                        <DataTemplate>
                           <TextBlock xom:Property.Name="{x:Static l:AddressObject.Country}"
                                      xom:Property.ChildObject="{x:Static l:EmployeeRowObject.Address}"/>
                        </DataTemplate>
                     </GridViewColumn.CellTemplate>
                  </GridViewColumn>
               </GridView.Columns>
            </GridView>
         </ListView.View>
      </ListView>
   </Grid>
</Window>